// SOMImage.cpp : implementation file
//

#include "stdafx.h"
#include "ImageLab.h"
#include "SOMImage.h"
#include "SOM.h"

// CSOMImage dialog

IMPLEMENT_DYNAMIC(CSOMImage, CDialog)

CSOMImage::CSOMImage(CWnd* pParent /*=NULL*/)
	: CDialog(CSOMImage::IDD, pParent)
{
	m_nID = CSOMImage::IDD;
	m_nParent = pParent;
}

CSOMImage::~CSOMImage()
{
}

void CSOMImage::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CSOMImage, CDialog)
	ON_WM_PAINT()
END_MESSAGE_MAP()


// CSOMImage message handlers


//paint the dialog
void CSOMImage::OnPaint()
{
	if(!c_image.IsNull())
	{
		CPaintDC dc(this);
		c_image.StretchBlt(dc, 0, 0, c_image.GetWidth(), c_image.GetHeight(), SRCCOPY);
		return;
	}
}

//destroy the dialog
void CSOMImage::PostNcDestroy()
{
	c_image.Destroy();
	CDialog::DestroyWindow();
}

//create the dialog
BOOL CSOMImage::Create()
{
	return CDialog::Create(m_nID, m_nParent);
}

//destroy the dialog
void CSOMImage::imageDestroy()
{
	c_image.Destroy();
	CDialog::DestroyWindow();
}

